package org.example.springboot_threadpool_demo.taskpool.task;

import java.util.concurrent.TimeUnit;

public class ComputeTask implements Runnable {

    private String groupName;
    private String data;

    public ComputeTask(String groupName, String data) {
        this.groupName = groupName;
        this.data = data;
    }

    @Override
    public void run() {
        System.out.println("compute task start.");
        try {
            TimeUnit.MINUTES.sleep(10);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }
}
